//
//  UIScrollView+Refresh.m
//  JPRefreshDemo
//
//  Created by Carpenter on 2018/2/12.
//  Copyright © 2018年 carpenter. All rights reserved.
//

#import "UIScrollView+Refresh.h"
#import "JPCustomRefreshGifHeader.h"
#import <UIKit/UIKit.h>

@implementation UIScrollView (Refresh)
 

-(void)addGifHeaderRefresh:(MJRefreshComponentRefreshingBlock)refreshBlock{
    self.mj_header = [JPCustomRefreshGifHeader headerWithRefreshingBlock:refreshBlock];
}
/** 添加头部刷新 */
- (void)addHeaderRefresh:(MJRefreshComponentRefreshingBlock)refreshBlock{
    self.mj_header =[MJRefreshNormalHeader headerWithRefreshingBlock:refreshBlock];
}
/** 开始头部刷新 */
- (void)beginHeaderRefresh{
    [self.mj_header beginRefreshing];
}
/** 结束头部刷新 */
- (void)endHeaderRefresh{
    [self.mj_header endRefreshing];
}
/** 添加脚部刷新 */
- (void)addFooterRefresh:(MJRefreshComponentRefreshingBlock)refreshBlock{
    self.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:refreshBlock];
}
/** 开始脚部刷新 */
- (void)beginFooterRefresh{
    [self.mj_footer beginRefreshing];
}
/** 结束脚部刷新 */
- (void)endFooterRefresh{
    [self.mj_footer endRefreshing];
}
-(void)endRefresh{
    [self endHeaderRefresh];
    [self endFooterRefresh];
}

@end
